import {MenuType, ToolbarType} from "../util/types";
import UserFlowItem from "../component/UserFlowItem.vue";
import FlowNode from "../component/FlowNode.vue";
import selectImg from '../assets/select.png';
import zoomIn from '../assets/zoomIn.png';
import zoomOut from '../assets/zoomOut.png';
import undo from '../assets/undo.png';
import redo from '../assets/redo.png';
import Save from '../assets/save.png';
import Clear from '../assets/clear.png';
import Adapt from '../assets/adapt.png';
import {OperateEnum} from "../util/enum.ts";

/**
 * Flow 配置选项
 */
export const flowOpt = {
    overlapMode: 1,
    autoWrap: true,
    metaKeyMultipleSelected: true,
    grid: {
        visible: false,
        size: 5
    },
    background: {
        backgroundImage: 'url("")',
        backgroundRepeat: 'repeat'
    },
    keyboard: {
        enabled: true,
    },
    stopZoomGraph: false, // 缩放
    stopScrollGraph: true // 滚动
}
/**
 * 自定义矩形圆角
 */
export const rectRadius = 5;
/**
 * 自定义文本style
 */
export const rectTxtStyle = {
    fontSize: '12px',
    fill: 'blue'
}
/**
 * 形状边框颜色
 */
export const shapeBorderColor = '#2987ff';

/**
 * 右侧菜单宽度
 */
export const MenuWidth = 250;
/**
 * 菜单
 */
export const MenuList : MenuType[] = [
    {
        key: 'own',
        label: '我的',
        expandContainer: UserFlowItem,
        opt: [
            {
                key: 'new',
                label: '新增',
                icon: 'new'
            }
        ]
    },
    {
        key: 'node',
        label: '基本流程图形状',
        expandContainer: FlowNode,
    }
];
/**
 * 列表点击选取字段
 */
export const ownClickField = 'label';
/**
 * 模拟我的数据
 */
export const ownList = [
    {
        key: '1',
        label: '测试数据1',
        time: '2023-04-03 00:00:00'
    },
    {
        key: '2',
        label: '测试数据2',
        time: '2023-04-03 00:00:00'
    },
    {
        key: '3',
        label: '测试数据3',
        time: '2023-04-03 00:00:00'
    },
    {
        key: '4',
        label: '测试数据4',
        time: '2023-04-03 00:00:00'
    },
    {
        key: '5',
        label: '测试数据5',
        time: '2023-04-03 00:00:00'
    },
    {
        key: '6',
        label: '测试数据6',
        time: '2023-04-03 00:00:00'
    },
    {
        key: '7',
        label: '测试数据7',
        time: '2023-04-03 00:00:00'
    }
];

/**
 * toolbar
 */
// 二次点击取消的工具
export const dbClickCancel: string[] = ['select']
export const toolbarList: ToolbarType[] = [
    {
        title: '框选',
        type: OperateEnum.Select,
        icon: selectImg
    },
    {
        title: '放大',
        type: OperateEnum.ZoomIn,
        icon: zoomIn
    },
    {
        title: '缩小',
        type: OperateEnum.ZoomOut,
        icon: zoomOut
    },
    {
        title: '适应',
        type: OperateEnum.Adapt,
        icon: Adapt
    },
    {
        title: '后退',
        type: OperateEnum.Undo,
        icon: undo
    },
    {
        title: '前进',
        type: OperateEnum.Redo,
        icon: redo
    },
    {
        title: '保存',
        type: OperateEnum.Save,
        icon: Save
    },
    {
        title: '清空',
        type: OperateEnum.Clear,
        icon: Clear
    }
];
